﻿using System;
using System.Security.Principal;
using System.Web.Mvc;
using DevFramework.Business.Concrete.Managers;

namespace DevFramework.MvcUI.Controllers
{
    public class AccountController : Controller
    {
        public ActionResult Login()
        {
            var windowsIdentity = WindowsIdentity.GetCurrent().Name;
            var index = windowsIdentity.IndexOf('\\');

            if (index == -1)
                throw new Exception("SamName");

            return View(model: windowsIdentity.ToLower().Substring(index + 1));
        }
    }
}